tasklet_schedule(&net_tx_tasklet);
}
-/*
- * This is the primary RECEIVE function for a network interface.
- * Note that, from the p.o.v. of /this/ OS it looks like a transmit.
- */
int netif_be_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
netif_t *netif = (netif_t *)dev->priv;
return 0;
drop:
- netif->stats.rx_dropped++;
+ netif->stats.tx_dropped++;
dev_kfree_skb(skb);
return 0;
}
skb_shinfo(skb)->nr_frags = 0;
skb_shinfo(skb)->frag_list = NULL;
- netif->stats.rx_bytes += size;
- netif->stats.rx_packets++;
+ netif->stats.tx_bytes += size;
+ netif->stats.tx_packets++;
/* The update_va_mapping() must not fail. */
if ( unlikely(mcl[0].args[5] != 0) )
skb->dev = netif->dev;
skb->protocol = eth_type_trans(skb, skb->dev);
- netif->stats.tx_bytes += txreq.size;
- netif->stats.tx_packets++;
+ netif->stats.rx_bytes += txreq.size;
+ netif->stats.rx_packets++;
netif_rx(skb);
netif->dev->last_rx = jiffies;
{
printk(KERN_ALERT "%s: full queue wasn't stopped!\n", dev->name);
netif_stop_queue(dev);
- return -ENOBUFS;
+ goto drop;
}
if ( unlikely((((unsigned long)skb->data & ~PAGE_MASK) + skb->len) >=
{
struct sk_buff *new_skb;
if ( unlikely((new_skb = alloc_skb_page()) == NULL) )
- return 1;
+ goto drop;
skb_put(new_skb, skb->len);
memcpy(new_skb->data, skb->data, skb->len);
dev_kfree_skb(skb);
if ( np->backend_state != BEST_CONNECTED )
{
spin_unlock_irq(&np->tx_lock);
- return 1;
+ goto drop;
}
i = np->tx->req_prod;
notify_via_evtchn(np->evtchn);
return 0;
+
+ drop:
+ np->stats.tx_dropped++;
+ dev_kfree_skb(skb);
+ return 0;
}